package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.mappers.DimensionsMapper;
import com.tanhua.model.db.Dimensions;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class DimensionsApiImpl implements DimensionsApi{

    @Autowired
    private DimensionsMapper dimensionsMapper;


    @Override
    public List<Dimensions> findAll() {
        return dimensionsMapper.selectList(null);
    }

    @Override
    public String findById(Integer dimensionsId) {
        QueryWrapper qw = new QueryWrapper();
        qw.eq("dimensions_id",dimensionsId);
        Dimensions dimensions = dimensionsMapper.selectOne(qw);
        return dimensions.getDimensionsContext();
    }
}
